﻿<%@ Page Language="C#" Inherits="E.Web.training.exam.TestSelf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>自我测验</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <script type="text/javascript" src="../silverlight/Silverlight.js"></script>
    <script type="text/javascript">
        function CloseWindow() {
            window.opener = null;      //只在IE6下有效，可以不提示关闭浏览器
            window.open('', '_self');  //原理就是将_self(自身)设置为一个window.open的引用后，用window.close(),就可以关闭了!
            window.close();
        } 
    </script>
    <script type="text/javascript">


        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
                appSource = sender.getHost().Source;
            }

            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;

            if (errorType == "ImageError" || errorType == "MediaError") {
                return;
            }

            var errMsg = "Silverlight 应用程序中未处理的错误 " + appSource + "\n";

            errMsg += "代码: " + iErrorCode + "    \n";
            errMsg += "类别: " + errorType + "       \n";
            errMsg += "消息: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError") {
                errMsg += "文件: " + args.xamlFile + "     \n";
                errMsg += "行: " + args.lineNumber + "     \n";
                errMsg += "位置: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {
                if (args.lineNumber != 0) {
                    errMsg += "行: " + args.lineNumber + "     \n";
                    errMsg += "位置: " + args.charPosition + "     \n";
                }
                errMsg += "方法名称: " + args.methodName + "     \n";
            }

            引发新错误(errMsg);
        }
    </script>

</head>
<body>

<% if (!err) { %>
<div style="width:1024px; height:768px; margin:0 auto;">
<%--<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="1024" height="768" id="GTR" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="flashVars" value="examid=<%=examid %>,<%=categoryid %>" />
	<param name="movie" value="test.swf" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#ffffff" />	
	<embed src="test.swf" quality="high" bgcolor="#ffffff" width="1024" height="768" name="GTR" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />
</object>--%>
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
	<param name="source" value="../silverlight/E.Silverlight.TestSelf.xap"/>
	<param name="onError" value="onSilverlightError" />
	<param name="background" value="white" />
	<param name="minRuntimeVersion" value="4.0.50401.0" />
	<param name="autoUpgrade" value="true" />
    <param name="initParams" value="examid=<%=examid %>,categoryid=<%=categoryid %>" />
	<a href="../silverlight/silverlight.exe" style="text-decoration:none">
 		<img src="../silverlight/slmedallion_chs.png" alt="获取 Microsoft Silverlight" style="border-style:none"/>
	</a>
</object>
</div>
<% } else { %>
   <div>考试信息错误</div>
<% } %>
</body>
</html>
